package com.service;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

@SuppressWarnings("ALL")
@Service
public class InvokeService {

    @Autowired
    private RestTemplate restTemplate;

    public String callback(){
        return "";
    }

    @HystrixCommand(fallbackMethod = "callback")
    public String go(){
        String url="http://service-b/controller";
        String result=restTemplate.getForObject(url,String.class);
        return result;
    }

}
